package com.group.transaction.service.operationLog.impl;

import com.alibaba.fastjson.JSONObject;
import com.group.transaction.domain.Logistics;
import com.group.transaction.domain.OperationLog;
import com.group.transaction.mapper.OperationLogMapper;
import com.group.transaction.model.ResultJson;
import com.group.transaction.service.operationLog.OperationLogSerivce;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class OperationLogSerivceImpl implements OperationLogSerivce {

    @Resource
    private OperationLogMapper operationLogMapper;

    @Override
    public ResultJson queryOperationLogData(OperationLog operationLog) {
        try {

            List<OperationLog> operationLogList = operationLogMapper.queryOperationLogData(operationLog);
            Integer total = operationLogMapper.queryOperationLogDataTotal(operationLog);
            Map<String,Object> map = new HashMap<>();
            map.put("list",operationLogList);
            map.put("total",total);
            return ResultJson.builder().code(1).message("成功").result(map).build();
        } catch (Exception e) {
            return ResultJson.builder().code(1).message("失败").build();
        }
    }

    @Override
    public Integer queryOperationLogDataTotal(OperationLog operationLog) {
        return null;
    }
}
